<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>  
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 
<%
String path = request.getContextPath();  
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">  
<html>
  <head>
    <base href="<%=basePath%>">  
    
    <title>My JSP 'index.jsp' starting page</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<link rel="stylesheet" type="text/css" href="css/maintable.css"  ></link>
	<meta http-equiv="description" content="This is my page">
	<script type="text/javascript"  src="js/jquery-1.8.0.js"></script>
  	<script>
  		function delet(id){
  			if(id=="${admin_session.roleId}"){
  				alert("自己也是这个角色不可以删除");
  				return false;
  			}else{
  				return confirm("确认要删除吗,删除后");
  			}
  		}
  	</script> 
  </head>
  
  <body>
	   <div class ="div_title">
				<div class="div_titlename"> <img src="images/san_jiao.gif" ><span>角色管理</span></div>
				<div class="div_titleoper">
				</div>
		</div>
	  <table class="main_table">
	 	 <tr><th>角色名称</th><th>角色描述</th><th>操作</th></tr>
	  	 <c:forEach var="roleInfo" items="${roleInfo }">
	  	 	<tr>
		  	 	<td>${roleInfo.roleName }</td>
		  	 	<td>${roleInfo.des }</td>
		  	 	<td>
		  	 		<a href="RoleServlet.do?flag=roleupdate&id=${roleInfo.id }" onclick="return confirm('确认要修改吗')">修改</a>|
		  	 		<a href="RoleServlet.do?flag=roledelete&id=${roleInfo.id }" onclick="return delet('${roleInfo.id }')">删除</a>|
		  	 		<a href="RoleServlet.do?flag=rolefenpei&roleId=${roleInfo.id }">角色权限分配</a>
		  	 	</td>
	  	 	</tr>
  		 </c:forEach>
	  </table>
  	<script>
  		var del='${delete}';
  		if(del!=""){
  			alert(del);
  		}
  	</script>
  </body>
</html>